import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '儒行科技校外教育系统 - 登录'
    },
    component: () =>
        import ('@/views/login.vue')
};

export const registerRouter = {
    path: '/register',
    name: 'register',
    meta: {
        title: '注册'
    },
    component: () =>
        import ('@/views/register/register.vue')
};

export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: () =>
        import ('@/views/error-page/404.vue')
};

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () =>
        import ('@//views/error-page/403.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () =>
        import ('@/views/error-page/500.vue')
};

export const preview = {
    path: '/preview',
    name: 'preview',
    component: () =>
        import ('@/views/form/article-publish/preview.vue')
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () =>
        import ('@/views/main-components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/user',
    component: Main,
    children: [{
            path: 'home',
            title: {
                i18n: 'home'
            },
            name: 'home_index',
            component: () =>
                import ('@/views/home/home.vue')
        }, {
            path: 'ownspace',
            title: '个人中心',
            name: 'ownspace_index',
            component: () =>
                import ('@/views/own-space/own-space.vue')
        }, {
            path: 'order/:order_id',
            title: '订单详情',
            name: 'order-info',
            component: () =>
                import ('@/views/advanced-router/component/order-info.vue')
        }, // 用于展示动态路由
        {
            path: 'shopping',
            title: '购物详情',
            name: 'shopping',
            component: () =>
                import ('@/views/advanced-router/component/shopping-info.vue')
        }, // 用于展示带参路由
        {
            path: 'message',
            title: '消息中心',
            name: 'message_index',
            component: () =>
                import ('@/views/message/message.vue')
        }
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
/*import User from '@/views/user/user.vue';
import Award from '@/views/award/award.vue';*/
export const appRouter = [{
    path: '/course',
    icon: 'ios-monitor-outline',
    name: 'course',
    title: '开班管理',
    component: Main,
    access: 1,
    children: [{
        path: 'classes',
        title: '开班设置',
        name: 'classes',
        component: () =>
            import ('@/views/classes/classes.vue')
    }, {
        path: 'courseaudit',
        title: '班级审核',
        name: 'courseaudit',
        component: () =>
            import ('@/views/classes-approvel/classes-approvel.vue')
    }, {
        path: 'courserelease',
        title: '班级发布',
        name: 'courserelease',
        component: () =>
            import ('@/views/classes-release/classes-release.vue')
    }/*, {
        path: 'courserelease',
        title: '班级发布',
        name: 'courserelease',
        component: () =>
            import ('@/views/test/test.vue')
    }*/]
},  {
    path: '/activity',
    icon: 'ios-baseball',
    name: 'activity',
    title: '活动管理',
    component: Main,
    access: 1,
    children: [{
        path: 'activitymanagement',
        title: '活动列表',
        name: 'activitymanagement',
        component: () =>
            import ('@/views/activitymanagement/activitymanagement.vue')
    },{
        path: 'activitybill',
        title: '活动报名',
        name: 'activitybill',
        component: () =>
            import ('@/views/activitybill/activitybill.vue')
    }]
},{
    path: '/signup',
    icon: 'pricetags',
    name: 'signup',
    title: '报名管理',
    component: Main,
    access: 1,
    children: [
        {
            path: 'purchase',
            title: '教材购买',
            name: 'purchase',
            component: () =>
                import ('@/views/purchase/purchase.vue')
        }, {
            path: 'deansignup',
            title: '教务报名',
            name: 'deansignup',
            component: () =>
                import ('@/views/deansignup/deansignup.vue')
        }, {
            path: 'studentsignup',
            title: '学员报名',
            name: 'studentsignup',
            component: () =>
                import ('@/views/studentsignup/studentsignup.vue')
        }, {
            path: 'studentsignquery',
            title: '学员报名查询',
            name: 'studentsignquery',
            component: () =>
                import ('@/views/studentsignquery/studentsignquery.vue')
        }
        /*,  {
                    path: 'teamsignup',
                    title: '集体报名',
                    name: 'teamsignup',
                    component: () => import('@/views/teamsignup/teamsignup.vue')
                }*/
    ]
}, {
    path: '/student',
    icon: 'folder',
    name: 'student',
    title: '学员管理',
    component: Main,
    access: 1,
    children: [{
        path: 'studentinfo',
        title: '学员信息管理',
        name: 'studentinfo',
        component: () =>
            import ('@/views/studentinfo/studentinfo.vue')
    }]
}, {
    path: '/teacher',
    icon: 'person-stalker',
    name: 'teacher',
    title: '教师管理',
    component: Main,
    access: 1,
    children: [{
        path: 'teacherinfo',
        title: '教师信息管理',
        name: 'teacherinfo',
        component: () =>
            import ('@/views/teacherinfo/teacherinfo.vue')
    }, {
        path: 'teacherschedule',
        title: '教师课表',
        name: 'teacherschedule',
        component: () =>
            import ('@/views/teacherschedule/teacherschedule.vue')
    }]
}, {
    path: '/attendanceInfo',
    icon: 'folder',
    name: 'attendanceInfo',
    title: '点到管理',
    component: Main,
    access: 1,
    children: [{
        path: 'attendance',
        title: '我要点到',
        name: 'attendance',
        component: () =>
            import ('@/views/attendance/attendance.vue')
    }]
}, {
    path: '/financialstatistics',
    icon: 'ios-calculator',
    name: 'financialstatistics',
    title: '财务统计',
    component: Main,
    access: 1,
    children: [{
        path: 'classesstatistics',
        title: '课程订单统计',
        name: 'classesstatistics',
        component: () =>
            import ('@/views/classesstatistics/classesstatistics.vue')
    }, {
        path: 'activitystatistics',
        title: '活动订单统计',
        name: 'activitystatistics',
        component: () =>
            import ('@/views/activitystatistics/activitystatistics.vue')
    },{
        path: 'materialstatistics',
        title: '教材购买订单统计',
        name: 'materialstatistics',
        component: () =>
            import ('@/views/materialstatistics/materialstatistics.vue')
    }]
},  {
    path: '/finance',
    icon: 'trophy',
    name: 'finance',
    title: '财务管理',
    component: Main,
    access: 1,
    children: [{
        path: 'trainingfee',
        title: '培训收费',
        name: 'trainingfee',
        component: () =>
            import ('@/views/trainingfee/trainingfee.vue')
    }, {
        path: 'balance',
        title: '余额管理',
        name: 'balance',
        component: () =>
            import ('@/views/balance/balance.vue')
    }, {
        path: 'trainingmanagement',
        title: '缴费管理',
        name: 'trainingmanagement',
        component: () =>
            import ('@/views/trainingmanagement/trainingmanagement.vue')
    }, {
        path: 'summary',
        title: '财务收费结算表',
        name: 'summary',
        component: () =>
            import ('@/views/summary/summary.vue')
    }, {
        path: 'refundrecord',
        title: '退费记录',
        name: 'refundrecord',
        component: () =>
            import ('@/views/refundrecord/refundrecord.vue')
    }, {
        path: 'financemanagement',
        title: '财务收支记录',
        name: 'financemanagement',
        component: () =>
            import ('@/views/financemanagement/financemanagement.vue')
    }, {
		path: 'test',
		title: '打印',
		name: 'test',
		component: () =>
			import ('@/views/test/test.vue')
	}]
}, {
    path: '/data',
    icon: 'social-buffer',
    name: 'data',
    title: '基础管理',
    component: Main,
    access: 1,
    children: [{
        path: 'major',
        title: '专业管理',
        name: 'major',
        component: () =>
            import ('@/views/major/major.vue')
    }, {
        path: 'orgmajor',
        title: '部门专业分配',
        name: 'orgmajor',
        component: () =>
            import ('@/views/org-major/org-major.vue')
    }, {
        path: 'classroom',
        title: '教室管理',
        name: 'classroom',
        component: () =>
            import ('@/views/classroom/classroom.vue')
    }, {
        path: 'book',
        title: '教材管理',
        name: 'book',
        component: () =>
            import ('@/views/book/book.vue')
    }]
}, {
    path: '/setup',
    icon: 'gear-b',
    name: 'setup',
    title: '系统管理',
    component: Main,
    access: 1,
    children: [{
        path: 'user',
        title: '用户管理',
        name: 'user',
        component: () =>
            import ('@/views/user/user.vue')
    }, {
        path: 'organize',
        title: '部门管理',
        name: 'organize',
        component: () =>
            import ('@/views/organize/organize.vue')
    }, {
        path: 'organizeSet',
        title: '站点全局设置',
        name: 'organizeSet',
        component: () =>
            import ('@/views/organizeSet/organizeSet.vue')
    }, {
        path: 'role',
        title: '角色管理',
        name: 'role',
        component: () =>
            import ('@/views/role/role.vue')
    }, {
        path: 'dictionary',
        title: '数据字典',
        name: 'dictionary',
        component: () =>
            import ('@/views/dictionary/dictionary.vue')
    }, {
        path: 'invoicemake',
        title: '发票模板',
        name: 'invoicemake',
        component: () =>
            import ('@/views/invoice/make/make.vue')
    }, {
        path: 'invoicecreate',
        title: '生成发票',
        name: 'invoicecreate',
        component: () =>
            import ('@/views/invoice/invoice.vue')
    }]
}];

// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    registerRouter,
    otherRouter,
    preview,
    locking,
    ...appRouter,
    page500,
    page403,
    page404
];